home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / e_os300b / wc_snap / test.c < prev   
Encoding:
C/C++ Source or Header  |  1996-12-02  |  1.7 KB  |  57 lines

  1. //╔══════════════════════════════════════════════════════════════════════════╗
  2. //║                                                                          ║
  3. //║ This example show how to use the Snap library                            ║
  4. //║                                                                          ║
  5. //║                                                                          ║
  6. //║                                                                          ║
  7. //╚══════════════════════════════════════════════════════════════════════════╝
  8.  
  9. #include <process.h>
  10. #include "..\resource\eos.h"
  11.  
  12. void copyvideo(long Selector_Vesa,char *Addr_File);
  13. #pragma aux copyvideo modify [eax edx esi edi] parm [eax] [esi] =  \
  14.    "push es"\
  15.    "mov es,ax"\
  16.    "xor edi,edi"\
  17.    "add esi,10"\
  18.    "mov edx,3c8h"\
  19.    "xor al,al"\
  20.    "out dx,al"\
  21.    "inc dl"\
  22.    "mov ecx,768"\
  23.    "@@Ok1:"\
  24.    "lodsb"\
  25.    "out dx,al"\
  26.    "loop @@Ok1"\
  27.    "mov ecx,76800"\
  28.    "rep movsd"\
  29.    "pop es";
  30.  
  31. void Wait_();
  32. #pragma aux Wait_ modify [eax]=  \
  33.    "xor ah,ah"\
  34.    "int 16h";
  35.  
  36. void test_vesa()
  37. {
  38.    long Selector_Vesa;
  39.    char *Addr_File;
  40.    long Size_File,Handle_File;
  41.     if (Init_Vesa(0x101)==Off)
  42.     Exit_Error ("   ■ Mode SVGA not supported or VESA not found ! \x0D\x0A" \
  43.                 "     To install a vesa driver, refer to your video card documentation. \x0D\x0A\x24");
  44.    Selector_Vesa=Init_Vesa_Bank();
  45.    Addr_File=Load_External_File_Handle ("..\\DATA\\TEST640.DLZ",&Size_File,&Handle_File);
  46.    copyvideo(Selector_Vesa,Addr_File);
  47.    Wait_();
  48.    Restore_Video_Mode();
  49. }
  50.  
  51. void main(int argn, char **argv)
  52. {
  53.     Init_Snap(); // Press key "Arrêt Défil" at any time to save the screen
  54.     Init_EOS();
  55.     test_vesa();
  56.   exit (0);
  57. }